3.22.64 \(\int \frac {x (1+x)^2}{(1+x+x^2)^3} \, dx\)

Optimal. Leaf size=33 \[ -\frac {(x+1) (2 x+1)}{6 \left (x^2+x+1\right )^2}-\frac {1}{6 \left (x^2+x+1\right )} \]

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {818, 629} \begin {gather*} -\frac {(x+1) (2 x+1)}{6 \left (x^2+x+1\right )^2}-\frac {1}{6 \left (x^2+x+1\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(x*(1 + x)^2)/(1 + x + x^2)^3,x]

[Out]

-((1 + x)*(1 + 2*x))/(6*(1 + x + x^2)^2) - 1/(6*(1 + x + x^2))

Rule 629

Int[((d_) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[(d*(a + b*x + c*x^2)^(p +
 1))/(b*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[2*c*d - b*e, 0] && NeQ[p, -1]

Rule 818

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> -Si
mp[((d + e*x)^(m - 1)*(a + b*x + c*x^2)^(p + 1)*(2*a*c*(e*f + d*g) - b*(c*d*f + a*e*g) - (2*c^2*d*f + b^2*e*g
- c*(b*e*f + b*d*g + 2*a*e*g))*x))/(c*(p + 1)*(b^2 - 4*a*c)), x] - Dist[1/(c*(p + 1)*(b^2 - 4*a*c)), Int[(d +
e*x)^(m - 2)*(a + b*x + c*x^2)^(p + 1)*Simp[2*c^2*d^2*f*(2*p + 3) + b*e*g*(a*e*(m - 1) + b*d*(p + 2)) - c*(2*a
*e*(e*f*(m - 1) + d*g*m) + b*d*(d*g*(2*p + 3) - e*f*(m - 2*p - 4))) + e*(b^2*e*g*(m + p + 1) + 2*c^2*d*f*(m +
2*p + 2) - c*(2*a*e*g*m + b*(e*f + d*g)*(m + 2*p + 2)))*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && Ne
Q[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && LtQ[p, -1] && GtQ[m, 1] && ((EqQ[m, 2] && EqQ[p, -3] &&
RationalQ[a, b, c, d, e, f, g]) ||  !ILtQ[m + 2*p + 3, 0])

Rubi steps

\begin {align*} \int \frac {x (1+x)^2}{\left (1+x+x^2\right )^3} \, dx &=-\frac {(1+x) (1+2 x)}{6 \left (1+x+x^2\right )^2}-\frac {1}{6} \int \frac {-1-2 x}{\left (1+x+x^2\right )^2} \, dx\\ &=-\frac {(1+x) (1+2 x)}{6 \left (1+x+x^2\right )^2}-\frac {1}{6 \left (1+x+x^2\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 22, normalized size = 0.67 \begin {gather*} -\frac {3 x^2+4 x+2}{6 \left (x^2+x+1\right )^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(x*(1 + x)^2)/(1 + x + x^2)^3,x]

[Out]

-1/6*(2 + 4*x + 3*x^2)/(1 + x + x^2)^2

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x (1+x)^2}{\left (1+x+x^2\right )^3} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(x*(1 + x)^2)/(1 + x + x^2)^3,x]

[Out]

IntegrateAlgebraic[(x*(1 + x)^2)/(1 + x + x^2)^3, x]

________________________________________________________________________________________

fricas [A]  time = 0.37, size = 32, normalized size = 0.97 \begin {gather*} -\frac {3 \, x^{2} + 4 \, x + 2}{6 \, {\left (x^{4} + 2 \, x^{3} + 3 \, x^{2} + 2 \, x + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(1+x)^2/(x^2+x+1)^3,x, algorithm="fricas")

[Out]

-1/6*(3*x^2 + 4*x + 2)/(x^4 + 2*x^3 + 3*x^2 + 2*x + 1)

________________________________________________________________________________________

giac [A]  time = 0.15, size = 20, normalized size = 0.61 \begin {gather*} -\frac {3 \, x^{2} + 4 \, x + 2}{6 \, {\left (x^{2} + x + 1\right )}^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(1+x)^2/(x^2+x+1)^3,x, algorithm="giac")

[Out]

-1/6*(3*x^2 + 4*x + 2)/(x^2 + x + 1)^2

________________________________________________________________________________________

maple [A]  time = 0.04, size = 20, normalized size = 0.61 \begin {gather*} \frac {-\frac {1}{2} x^{2}-\frac {2}{3} x -\frac {1}{3}}{\left (x^{2}+x +1\right )^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(x+1)^2/(x^2+x+1)^3,x)

[Out]

(-1/2*x^2-2/3*x-1/3)/(x^2+x+1)^2

________________________________________________________________________________________

maxima [A]  time = 0.52, size = 32, normalized size = 0.97 \begin {gather*} -\frac {3 \, x^{2} + 4 \, x + 2}{6 \, {\left (x^{4} + 2 \, x^{3} + 3 \, x^{2} + 2 \, x + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(1+x)^2/(x^2+x+1)^3,x, algorithm="maxima")

[Out]

-1/6*(3*x^2 + 4*x + 2)/(x^4 + 2*x^3 + 3*x^2 + 2*x + 1)

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 20, normalized size = 0.61 \begin {gather*} -\frac {3\,x^2+4\,x+2}{6\,{\left (x^2+x+1\right )}^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x*(x + 1)^2)/(x + x^2 + 1)^3,x)

[Out]

-(4*x + 3*x^2 + 2)/(6*(x + x^2 + 1)^2)

________________________________________________________________________________________

sympy [A]  time = 0.12, size = 31, normalized size = 0.94 \begin {gather*} \frac {- 3 x^{2} - 4 x - 2}{6 x^{4} + 12 x^{3} + 18 x^{2} + 12 x + 6} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(1+x)**2/(x**2+x+1)**3,x)

[Out]

(-3*x**2 - 4*x - 2)/(6*x**4 + 12*x**3 + 18*x**2 + 12*x + 6)

________________________________________________________________________________________